<?php
namespace app\index\controller;
/**
 * Created by Submint Text.
 * User: hetaoren<452649510@qq.com>
 * Date: 2017/03/10
 * Explain: 商品控制器
 */
class Goods extends Base{
   /**
	* 查看商品列表
	*/
	public function index(){
        $this->assign("staffRoleId",session("HTR_STAFF.staffRoleId"));
		return $this->fetch();
	}
    /**
     * 获取分页
     */
    public function pageQuery(){
        return model('Goods')->pageQuery();
    }
    /**
     * 跳去编辑页面
     */
    public function toEdit(){
        $id = input("id/d",0);
        $object = model('Goods')->get($id);
        $data['object'] = $object;      
        return $this->fetch("edit",$data);
    }
    /**
     * 新增
     */
    public function add(){
        return model('Goods')->add();
    }
    /**
     * 编辑
     */
    public function edit(){
        return model('Goods')->edit();
    }
    /**
     * 删除商品
     */
    public function del(){
    	return model('Goods')->del();
    }
}
